Skip to content

Conversation

andreabedini
Copy link
Member

Marked as draft to avoid merging.

@andreabedini andreabedini force-pushed the stable-haskell/feature/cross-compile branch 2 times, most recently from 985b8b7 to 9abf046 Compare July 14, 2025 09:23
sergv and others added 11 commits July 15, 2025 20:02
If extra-lib-dirs and/or extra-include-dirs are specified via either
command line or project files, they’re going to be added for each
package in the dendency graph. With enough long enough directories
the command-line length limits for gcc may be hit and calls to
the C compiler made from hsc2hs will start failing.

Ideally hsc2hs should be using repsonse files, but needlessly
specifying myriad of command-line parameters is redundant anyway.
- Bump to hlint-3.10 in the gh-action
@andreabedini andreabedini force-pushed the stable-haskell/feature/cross-compile branch from 9abf046 to eeff3cd Compare July 22, 2025 06:54
jgotoh and others added 14 commits July 22, 2025 11:15
The new parser replicates the grammar of the legacy parser while providing
better error reporting and more maintainable code structure. The fallback
strategy ensures smooth transition while the legacy parser is phased out.

The flag `--project-file-parser` allows you to select which project file
parser to use.

* `legacy` - the old parser (will be removed in a future release)
* `default` - the default parser (uses `fallback` unless compiled with `-f+legacy-comparison`)
* `parsec` - the new parser using Parsec
* `fallback` - the new parser using Parsec, but falling back to the old parser if it fails
* `compare` - the new parser using Parsec, but comparing the results with the old parser

When `cabal-install` is compiled, then the `-f+legacy-comparision` flag
can be passed which changes the default parser mode to `compare`.

Fixes haskell#6101 haskell#7748 haskell#10611
* Error messages are indented by 2 spaces
* 0:0 positions are never shown
* More attempts are made to remove extra newlines.
Simply disabling the step causes all non-Windows to fail, so we
now skip it only on Windows.
andreabedini and others added 29 commits August 21, 2025 13:51
available targets are only host
Isolate the common logic between building and only downloading.

_Push the ifs up and the loops down_
Determine packages to build in-place by their solver id, not their package id.
Cabal uses a peculiar c program to check if LD supports and should
use -x. To do this, it shells out to GHC to compiler the C file.
This however requires that GHC will not bail out, yet cabal does
not pass --package-db flags to this GHC invocation, and as such we
can run into situations where GHC bails out, especially during GHC
bootstrap phases where not all boot packages are available.

We however do not need GHC to compiler a c program, and can rely
on the C compiler.

Fundamentally cabal does not allow modelling program dependencies
in the program db, as such we must configure gcc first before using
it.

We make a small change to lib:Cabal (specifically the GHC module,
and it's Internal companion) to allow it to configure gcc first,
before trying to configure ld, and thus having gcc in scope while
configuring ld. This removes the need for the awkward ghc
invocation to compiler the test program.
Split the function into multiple ones.
If a node has dangling edges, then the list of missing neighbours cannot be empty.
Exceptions are not nice but this is an obvious invariant. Graph should provide a better API to make this unnecessary.
Not really a fix. I do not know why this happens.
It is duplicate information since we write the program invocation right after.
@andreabedini andreabedini force-pushed the stable-haskell/feature/cross-compile branch from 7d3b026 to ab0a509 Compare August 22, 2025 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants